A Pie chart with tooltips
This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.pie.js"></script>
<style>
.RGraph_tooltip {
padding-left: 0 !important;
padding-right: 0 !important;
padding: 10px !important;
font-size: 16pt !important;
font-weight: bold !important;
text-align: center !important;
}
&ly;/style>
Put this where you want the chart to show up:
<canvas id="cvs" width="350" height="250">
[No canvas support]
</canvas>
This is the code that generates the chart:
<script>
window.onload = function ()
{
var pie = new RGraph.Pie({
id: 'cvs',
data: [4,8,4,6,5,3,2,5],
options: {
gutterLeft: 75,
labels: ['Alvin','Pete','Hoolio','Jack','Kev','Luis','Lou','Pete'],
shadowOffsetx: 0,
shadowOffsety: 0,
shadowBlur: 15,
strokestyle: 'transparent',
exploded: [15,15],
tooltips: ['Alvin','Pete','Hoolio','Jack','Kev','Luis','Lou','Pete'],
textAccessible: true,
labelsSticksList: true,
labelsSticksLinewidth: 0.5,
labelsSticksUsecolors: false
}
}).draw();
};
</script>